package org.thread.test06.ts.demo03;

/**
 * @author CSY
 * @date 2025 - 03 - 13
 */
public class MyThread extends Thread{
    /**
     * 锁对象
     */
    public static final String LOCK = "";

    @Override
    public void run() {
        synchronized (LOCK) {
            try {
                //线程等待 - wait方法释放锁对象
                LOCK.wait();

//                Thread.sleep(5000);
                System.out.println("Good morning!");
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
